<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="uct" uri="/WEB-INF/uct.tld" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<%@ include file="/common/sale/include/common-base.jsp"%>
	<script src="${ctx}/js/jquery-tools.min.js"></script>
  <title>二次挂牌项目管理</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>

<!-- 以下是body主体内容的模块区域 -->
<body class="hold-transition ${sysUserColor} sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/sale/top-user.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left-user.jsp" %>
  <!-- left end-->

<div class="content-wrapper">
	<div class="content">
		<div class="row">
			<div class="col-lg-12 rightmt">
           <div class="right_box" style="display: none;">
          <!------搜索  start ------->
			  	<form id="searchForm" class="form-horizontal">
				<input type="hidden" name="doCode" value="dymicSql"/>
				<input type="hidden" name="pageName" value="trsGoods-list">
				<input type="hidden" name="formName" value="searchForm">
				<input type="hidden" name="trsGoods.w_delStatus" value="F">
				<!-- 
				<input type="hidden" name="trsGoods.userEname" value="${loginUser.userEname}"/>
				 -->
				<input type="hidden" name="orderBy"  value="trsGoods.create_time desc" />
				 		
				 	<!-- 我的搜索 start -->
			 		<h4 class="user_title">
					   <p><i class="fa fa-search"></i><span>持仓搜索</span></p>
					 </h4>
					 
					<div class="form-group">	
						<label  class="col-sm-3 control-label">
							商品代码：
						</label>
						<div class="col-sm-2">
							<input type="text" class="form-control clean"  name="trsGoods.wl_proNo" id="proNo" value="" />
						</div>
						<label  class="col-sm-3 control-label">
							商品名称：
						</label>
						<div class="col-sm-2">
							<input type="text" class="form-control clean"  name="trsGoods.wl_proName" id="proName" value="" />
						</div>
						
				
					</div>
				<center>
				   <div class="box-footer clearfix">
				       <button type="button" class="btn btn-danger " onclick="getTableData();">查询</button> 
				       <button  type="button" class="btn btn-primary" onclick="cleanData('searchForm');">重置 </button>
				   </div>
				</center>
			  </form>
	     </div>
	     <!------- 搜索 end -------->
	     <!------- 列表 start -------->
            <div class="right_box" style="margin-top:20px;">
				         <!-- 我的挂牌搜索 start -->
								 <h4 class="user_title">
								   <p><i class="fa fa-line-chart"></i><span>项目列表</span></p>
								 </h4>
					    <!-- 我的挂牌搜索 end -->   
			            <table id="dataList" class="table table-hover user_table" >
			                <thead>
			                <tr>
			                   	<th>所属品种</th>
		                        <th>产品编号</th>
		                        <th>产品名称</th>
		                        <th>产品数量</th>
		                        <th>当前状态</th>
		                        <th>是否再次转让</th>
								<th>操作</th>
			                </tr>
			                </thead>
			                <tbody id="dataList-body">
			                </tbody>
			              </table>
		         	    <center>
		    	  			  <ul id="dataList-page"></ul>
		        		</center>
			        </div>
			     
        <!------- 列表 end -------->
        </div>
        <!-- right end -->
      </div>
	  </div>
	  </div>
    <!-- Main end -->
</div>
  <!-- /.content-wrapper -->
  <!-- foot start -->
  <%@include file="/common/sale/foot-user.jsp" %>
  <!-- foot start -->

</body>


<!-- 以下是template列表模板的模块区域 -->
<script type="text/template" id="dataList-template">
		<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
			<td class="text_c">金融股权</td>
			<td class="text_c">G62017BJ10<?=i+1?></td>
			<td class="text_c">外贸金融租赁股权00<?=i+1?></td>
			<td class="text_c"><?=(i*3)?>000</td>
			<td class="text_c">可用</td>
			<td class="text_c">允许</td>
			<td class="text_c">
				<button class="btn btn-success" style="margin: 0 2px;padding:3px 6px;" onclick="goSecondTransferPage()">二次转让申请</button>
			</td>	
		</tr>
   <?}?>  		
</script>

</html>

<!-- 以下是js模块区域 -->
<script>
var clickMenu = "offerbuymanagement";
var id,myPage,dataListId,searchFormId,isShowLog,tableSort,tableId;
myPage = 10;
dataListId = "dataList";
searchFormId = "searchForm";
tableSort = "trsGoods";
tableId = "goodsId";
isShowLog = true;

$(function () {
	//1、加载分页列表数据
	getTableData();
	//2、控制是否启用token
	//setToken();
	
	//请在下面补充其他初始化方法（如数据字典、页面加载数据等）
	//3、初始化数据字典
 });
var dateObject = $('.datepicker').datepicker( {
	language : 'zh-CN',
	//inline: true,
	todayBtn : "linked",
	format : "yyyy-mm-dd",
	autoclose: true
});
//加载列表数据
function getTableData(){
	deleteAllRow(dataListId);
	//搜索框去除空格
	 $("#proNo").val($("#proNo").val().trim());
	 $("#proName").val($("#proName").val().trim());
	
	 $.ajax({
		   type:'get',
		   url:common_list_url,
		   data:$("#"+searchFormId).serialize()+getCurrentPage(common_list_url+"?"+$("#"+searchFormId).serialize(),myPage),
		   dataType:'json',
		   success: function(myData){
		   if(isShowLog)console.log(myData);
			var data = baidu.template(dataListId+"-template",eval(myData));  
			$("#"+dataListId+"-body").html(data);
			  var option= {
					   ele:$("#"+dataListId+"-page")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$("#"+searchFormId).serialize()
				   }
				generatePages(option);
		   }
		});	
  }

function refresh(){
	getTableData();
}


function setToken(){
	$.ajax({
	    type:'get',
	    url:'/sendPage/token?token=true',
	    dataType:'text',
	    success: function(myData){
	    	console.log(myData);
			$('#addForm_formToken').val(myData);
			$('#editForm_formToken').val(myData);
	  	}
	});	
}



/****  以下是自定义新增方法  ****/
 
 function goSecondTransferPage(){
	window.location.href="${ctx}/sendPage/sale/web/pubt/secondtransfer"
}
</script>
